#include "Rabin_Karp.hpp"
#include <ctime>

void run(){
    vector<int> d = {2,2,10,10};
    vector<int> q = {13,1009,13,1009};
    for (size_t i = 0; i < 5; i++)
    {
        string P;
        string T;
        getline(cin, P);
        getline(cin, T);
        for (size_t j = 0; j < 4; j++)
        {
            time_t begin, end;
            cout << "(n,m) case " << i+1 << "; (d,q) case " << j+1 << endl;
            Rabin_Karp_Matcher matcher(T, P, d[j], q[j]);
            begin = clock();
            auto out = matcher.run_Matcher();
            end = clock();
            cout << "real match num = " << out[0] << endl;
            cout << "fake match num = " << out[1] << endl << endl;
            cout << "time = " << end - begin;
        }
    }
}

int main(){
    run();
}